#!/usr/bin/env python
# -*- coding: utf-8 -*-

import numpy as np
from bezier import Curve

def create_stroke(control_points):
    """创建单个贝塞尔曲线笔画"""
    nodes = np.asfortranarray([
        [control_points[0][0], control_points[1][0], control_points[2][0]],
        [control_points[0][1], control_points[1][1], control_points[2][1]],
    ])
    return Curve(nodes, degree=2)

def create_character(strokes):
    """组合多个笔画形成汉字"""
    character = []
    for stroke_points in strokes:
        stroke = create_stroke(stroke_points)
        character.append(stroke)
    return character

# 示例：创建「一」字的笔画
horizontal_stroke = [
    (0, 50),   # 起始点
    (50, 50),  # 控制点
    (100, 50)  # 结束点
]

# 创建单个笔画
stroke = create_stroke(horizontal_stroke)
